package org.traffometer.traffobase.webapp.control.command;

import org.traffometer.traffobase.model.PacketStore;
import org.traffometer.traffobase.webapp.control.Page;
import javax.servlet.http.HttpServletRequest;

/**
 * Implements the "GetMap" command which shows the location of the car
 * from the latitude and longitude of the traffopackets.
 *
 * @author Kiet Huynh
 */
public class GetMapCommand implements Command {

  /**
   * Processes the "Display" command sent by the user.
   * Sets the stackIterator attribute with the current stack contents.
   *
   * @param request The request object.
   * @param packetStore The packet store.
   * @return The page to be displayed (Page.INDEX).
   */
  public Page process(HttpServletRequest request, PacketStore packetStore) {
    request.setAttribute("packetStoreIterator", packetStore.iterator());
    return Page.MAP;
  }
}